/*   1:    */ package com.atomikos.icatch;
/*   2:    */ 
/*   3:    */ import java.io.Serializable;
/*   4:    */ import java.lang.reflect.Field;
/*   5:    */ import java.util.Enumeration;
/*   6:    */ import java.util.Vector;
/*   7:    */ 
/*   8:    */ public class TxState
/*   9:    */   implements Serializable
/*  10:    */ {
/*  11:    */   static final long serialVersionUID = 648321112075712930L;
/*  12: 44 */   public static final TxState ACTIVE = new TxState("ACTIVE");
/*  13: 46 */   public static final TxState MARKED_ABORT = new TxState("MARKED_ABORT");
/*  14: 48 */   public static final TxState LOCALLY_DONE = new TxState("LOCALLY_DONE");
/*  15: 50 */   public static final TxState PREPARING = new TxState("PREPARING");
/*  16: 52 */   public static final TxState IN_DOUBT = new TxState("IN_DOUBT");
/*  17: 54 */   public static final TxState ABORTING = new TxState("ABORTING");
/*  18: 56 */   public static final TxState COMMITTING = new TxState("COMMITTING");
/*  19: 59 */   public static final TxState SUSPENDED = new TxState("SUSPENDED");
/*  20: 62 */   public static final TxState HEUR_COMMITTED = new TxState("HEUR_COMMITTED");
/*  21: 63 */   public static final TxState HEUR_ABORTED = new TxState("HEUR_ABORTED");
/*  22: 64 */   public static final TxState HEUR_MIXED = new TxState("HEUR_MIXED");
/*  23: 65 */   public static final TxState HEUR_HAZARD = new TxState("HEUR_HAZARD");
/*  24: 67 */   public static final TxState TERMINATED = new TxState("TERMINATED");
/*  25:    */   private final String myName;
/*  26:    */   
/*  27:    */   public static Enumeration getStates()
/*  28:    */   {
/*  29: 73 */     Vector v = new Vector();
/*  30: 74 */     Class myClass = TxState.class;
/*  31: 75 */     Field[] fields = myClass.getFields();
/*  32: 76 */     for (int i = 0; i < fields.length; i++) {
/*  33:    */       try
/*  34:    */       {
/*  35: 78 */         v.addElement(fields[i].get(null));
/*  36:    */       }
/*  37:    */       catch (Exception e) {}
/*  38:    */     }
/*  39: 83 */     return v.elements();
/*  40:    */   }
/*  41:    */   
/*  42:    */   private TxState(String s)
/*  43:    */   {
/*  44: 93 */     this.myName = s;
/*  45:    */   }
/*  46:    */   
/*  47:    */   public String toString()
/*  48:    */   {
/*  49: 96 */     return this.myName;
/*  50:    */   }
/*  51:    */   
/*  52:    */   public int hashCode()
/*  53:    */   {
/*  54:100 */     return this.myName.hashCode();
/*  55:    */   }
/*  56:    */   
/*  57:    */   public boolean equals(Object obj)
/*  58:    */   {
/*  59:104 */     if (this == obj) {
/*  60:105 */       return true;
/*  61:    */     }
/*  62:108 */     if (getClass() != obj.getClass()) {
/*  63:109 */       return false;
/*  64:    */     }
/*  65:110 */     TxState other = (TxState)obj;
/*  66:111 */     return this.myName.equals(other.myName);
/*  67:    */   }
/*  68:    */ }


/* Location:           C:\myfile\mysoft\apache-maven-3.5.0-bin\apache-maven-3.5.0\myrep\com\atomikos\transactions-api\3.7.0\transactions-api-3.7.0.jar
 * Qualified Name:     com.atomikos.icatch.TxState
 * JD-Core Version:    0.7.0.1
 */